Skip to content

feat(ha-mirror): V2 room assignment — mirrored HA entities land in their Brilliant rooms - #29

Open
btli wants to merge 4 commits into
mainfrom
feat/ha-mirror-room-assignment
Open

feat(ha-mirror): V2 room assignment — mirrored HA entities land in their Brilliant rooms#29
btli wants to merge 4 commits into
mainfrom
feat/ha-mirror-room-assignment

Conversation

@btli

@btli btli commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Maps each mirrored HA entity's area (entity area, device-area fallback via the HA WS registries) to a Brilliant room by case-insensitive name match; ROOM_OVERRIDES takes precedence; unmatched entities stay unassigned (logged once).
  • Reads the Brilliant room catalog from the home_configuration peripheral's rooms variable via a dedicated read-only RPCObserver connection (the firmware PeripheralHost exposes no registry-read API — live-verified).
  • Reflects room_assignment on each hosted peripheral via the existing _set_value_internal path, passing the RoomAssignment struct object (the framework's type validation rejects the serialized string form — live-verified).
  • Catalog fetch failures degrade to skip-assignment-this-cycle (last known catalog retained) instead of crashing the supervisor loop.
  • Research note with the live-verified firmware facts: docs/superpowers/research/2026-07-11-ha-mirror-room-assignment.md (corrects the 2026-07-10 note: room_ids entries are catalog Room.id verbatim — no timestamp to append).

Live pilot verification (office.iot)

All five mirrored lamps assigned correctly on the bus after leader election, no supervisor errors:

HA Backyard Lamp 1 -> ['Backyard']
HA Backyard Lamp 2 -> ['Backyard']
HA Backyard Lamp 3 -> ['Backyard']
HA Balcony Lamp 1  -> ['Balcony']
HA Balcony Lamp 2  -> ['Balcony']

Zero new required config: the HA areas (Backyard/Balcony) name-match the existing Brilliant rooms.

Gate

uv run ruff check --fix && uv run ruff format && uv run mypy --strict src tests && uv run pytest753 passed, 1 skipped (firmware-only), mypy --strict clean. Integration (custom_components/, ha/) untouched.

🤖 Generated with Claude Code

btli and others added 4 commits July 12, 2026 13:04
…eir Brilliant rooms

Map each mirrored entity's HA area (entity area, device-area fallback) to a
Brilliant room by case-insensitive name match — ROOM_OVERRIDES takes
precedence — and reflect room_assignment on the hosted peripheral so mirrored
devices appear under their room on every panel. Unmatched entities stay
unassigned (logged once).

Live-verified on the pilot: rooms catalog read from home_configuration.rooms
via a dedicated read-only RPCObserver connection (the firmware PeripheralHost
exposes no registry read); room_assignment reflected via _set_value_internal
with the RoomAssignment STRUCT object (a serialized string is rejected by the
framework's type validation); catalog fetch failures degrade to skip-this-cycle
instead of crashing the supervisor. All five mirrored backyard/balcony lamps
verified assigned to their Backyard/Balcony rooms on the bus.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant